/*:
 * @plugindesc 隱藏视窗背景
 * @author 小c
 * @version 1.0.0
 * @date 1/11/2020
 *
 * @param Scene List
 * @text 透明视窗Scene列表
 * @type text[]
 * @desc 需要透明化视窗的Scene列表
 *
 */

var HideWindowSkinManager = HideWindowSkinManager || {};
var Imported  = Imported || {};
Imported.CP_HideWindowSkin = true;

var params = PluginManager.parameters("CP_HideWindowSkin");

HideWindowSkinManager.SCENE_LIST = JSON.parse(params["Scene List"]);
for(var i = 0; i < HideWindowSkinManager.SCENE_LIST.length; i++){
	var sceneName = HideWindowSkinManager.SCENE_LIST[i];
	HideWindowSkinManager.SCENE_LIST[i] = ("scene instanceof " + sceneName).trim();
}

HideWindowSkinManager.IsHiddenScene = function(scene){
	for(var i = 0; i < this.SCENE_LIST.length; i++){
		if(eval(this.SCENE_LIST[i]))
			return true;
	}
	return false;
};

HideWindowSkinManager.SCENE_ADD_WINDOW = Scene_Base.prototype.addWindow;
Scene_Base.prototype.addWindow = function(window){
	if(HideWindowSkinManager.IsHiddenScene(this))
		window.opacity = 0;

	HideWindowSkinManager.SCENE_ADD_WINDOW.call(this, window);
};